home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Libraries / CMovieController 1.0 / CShellDialog.cp < prev    next >
Text File  |  1994-04-20  |  2KB  |  89 lines

  1. /******************************************************************************
  2.  CShellDialog.cp
  3.  
  4.         
  5.     SUPERCLASS = CDLOGDirector
  6.     
  7.     Copyright © 1994 Johns Hopkins University. All rights reserved.
  8.     
  9.  
  10.  ******************************************************************************/
  11.  
  12. #include "CShellDialog.h"
  13. #include "CDialog.h"
  14. #include "CMovieController.h"
  15.  
  16. #define    kShellDialogIDwo            1024
  17.  
  18. enum        /* window item numbers    */
  19. {
  20.     kOKBtn = 1
  21. };
  22.  
  23. extern CApplication    *gApplication;
  24.  
  25. /******************************************************************************
  26.  IShellDialog
  27. ******************************************************************************/
  28.  
  29. void CShellDialog::IShellDialog( short ShellDialogID)
  30. {
  31.     
  32.     CDLOGDirector::IDLOGDirector( ShellDialogID, gApplication);
  33.     
  34.     ((CDialog*)itsWindow)->SetDefaultCmd( cmdOK);
  35.     
  36.     // if there is not a CMovieController in the DITL then create it on the fly
  37.     if (ShellDialogID == kShellDialogIDwo){
  38.         itsMC = new CMovieController;
  39.         itsMC->IMovieController(itsWindow, this, 0, 0, 0, 0,sizELASTIC, sizELASTIC);
  40.         itsMC->OpenMovie();
  41.         if (itsMC->itsMovie)
  42.             SizeWindow(itsWindow->macPort, itsMC->width, itsMC->height, TRUE);
  43.     }
  44.     
  45. }    /* CShellDialog::IShellDialog */
  46.  
  47. /******************************************************************************
  48.  DoCommand
  49. ******************************************************************************/
  50.  
  51. void CShellDialog::DoCommand( long aCmd)
  52. {
  53.     switch (aCmd)
  54.     {
  55.         case cmdOK:
  56.         case cmdCancel:
  57.             dismissCmd = aCmd;
  58.             Close(FALSE);
  59.             break;
  60.             
  61.         default: 
  62.                 inherited::DoCommand( aCmd);
  63.                 break;
  64.     }
  65.                 
  66. }    /* CShellDialog::DoCommand */
  67.  
  68. /******************************************************************************
  69.  ProviderChanged
  70. ******************************************************************************/
  71.  
  72. void CShellDialog::ProviderChanged( CCollaborator *aProvider, long reason,
  73.                                         void *info)
  74. {
  75.     inherited::ProviderChanged( aProvider, reason, info);
  76.  
  77. }    /* CShellDialog::ProviderChanged */
  78.  
  79. /******************************************************************************
  80.  Dispose
  81. ******************************************************************************/
  82.  
  83. void CShellDialog::Dispose( void)
  84. {
  85.     ForgetObject(itsMC);
  86.     inherited::Dispose();
  87. }
  88.  
  89.